package com.xc.shopping_font.Controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xc.shopping_font.common.Result;
import com.xc.shopping_font.entity.Notice;
import com.xc.shopping_font.mapper.NoticeMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Slf4j
@RequestMapping("/notice")
public class NoticeController {

    @Resource
    private NoticeMapper noticeMapper;

    @GetMapping
    public Result getNotices(){

        QueryWrapper<Notice> queryWrapper = new QueryWrapper<>();

        queryWrapper.eq("show_status",1);

         return Result.success( noticeMapper.selectList(queryWrapper));


    }


}
